<div id="wrapper">
    <div id="page-wrapper">
        <div class="panel panel-primary">
            <div class="panel-heading"><h5 class="panel-title"></h5></div>
            <div class="panel-body">
                <div id="toolbar" class="ms-toolbar">
                    <button id="toolbar-add" class="btn btn-danger" data-toggle="modal" data-target="#myModal">
                        <span class="glyphicon glyphicon-plus"></span> 增加
                    </button>
                </div>
                <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true">
                    <div class="modal-dialog">
                        <div id="addbrand" class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal"
                                        aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">增加分区</h4>
                            </div>
                            <div class="modal-body">
                                <form id='regionForm' class="form-horizontal" role="form" enctype="multipart/form-data">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分区名称</label>

                                        <div class="col-sm-10">
                                            <input name='name' type="text" class="form-control" placeholder="请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分区标题</label>

                                        <div class="col-sm-10">
                                            <input name='title' type="text" class="form-control"
                                                   placeholder="请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">开始时间</label>

                                        <div class="col-sm-10">
                                            <input id="start_time" name='start_time' type="text" class="form-control"
                                                   placeholder="请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">结束时间</label>

                                        <div class="col-sm-10">
                                            <input id="end_time" name='end_time' type="text" class="form-control"
                                                   placeholder="请勿使用特殊字符">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">是否打开</label>

                                        <div class="col-sm-10">
                                            <select name='is_open' class="form-control">
                                                <option value="1">开</option>
                                                <option value="0">关</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">父分区</label>

                                        <div class="col-sm-10">
                                            <select class="form-control" id="parent_id" name="parent_id""></select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">分区图片</label>

                                        <div class="col-sm-10">
                                            <input id="loadimg" name="file" type="file" multiple class="file-loading"
                                                   data-url="">
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div class="modal-footer">
                                <button id="close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                                </button>
                                <button id="confirm" type="button" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <table id="brandtable" class="table table-bordered">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>父分区</th>
                            <th>名称</th>
                            <th>标题</th>
                            <th>状态</th>
                            <th>开始时间</th>
                            <th>结束时间</th>
                            <th>缩略图</th>
                            <th>编辑</th>
                            <th>删除</th>
                        </tr>
                        </thead>
                        <tbody>
                        {%notempty name="$data"%}
                        {%volist name="$data->toArray()['data']" id="vo"%}
                        <tr id="region{%$vo.rid%}">
                            <td>{%$vo.rid%}</td>
                            <td>{%$vo.parent_id%}</td>
                            <td>{%$vo.name%}</td>
                            <td>{%$vo.title%}</td>
                            <td>{%$vo.is_open%}</td>
                            <td>{%$vo.start_time%}</td>
                            <td>{%$vo.end_time%}</td>
                            <td class="chakan"><a href={%$vo.thumb%} data-lightbox={%$vo.rid%}>查看</a></td>
                            <td class="editregion">
                                <button class="btn btn-danger btn-sm">编辑</button>
                            </td>
                            <td class="delregion">
                                <button class="btn btn-danger btn-sm">删除</button>
                            </td>
                        </tr>
                        {%/volist%}
                        </tbody>
                    </table>
                    <div class="pull-right">
                        {%$data->render()%}
                    </div>
                    {%/notempty%}
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="editregion" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">编辑分区</h4>
            </div>
            <div class="modal-body">
                <form id='edit_regionForm' class="form-horizontal" role="form" enctype="multipart/form-data">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分区ID</label>

                        <div class="col-sm-10">
                            <input id="edit_rid" name='rid' type="text" class="form-control" disabled>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分区名称</label>

                        <div class="col-sm-10">
                            <input id="edit_name" name='name' type="text" class="form-control" placeholder="请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分区标题</label>

                        <div class="col-sm-10">
                            <input id="edit_title" name='title' type="text" class="form-control" placeholder="请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">开始时间</label>

                        <div class="col-sm-10">
                            <input id="edit_start_time" name='start_time' type="datetime" class="form-control"
                                   placeholder="请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">结束时间</label>

                        <div class="col-sm-10">
                            <input id="edit_end_time" name='end_time' type="datetime" class="form-control"
                                   placeholder="请勿使用特殊字符">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">是否打开</label>

                        <div class="col-sm-10">
                            <select id="edit_is_open" name='is_open' class="form-control">
                                <option value="1">开</option>
                                <option value="0">关</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">父分区</label>

                        <div class="col-sm-10">
                            <select class="form-control" id="edit_parent_id" name="parent_id"
                                    style="width:100%;"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">分区图片</label>

                        <div class="col-sm-10">
                            <input id="edit_img" name="file" type="file" multiple class="file-loading">
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="edit_close" type="button" class="btn btn-primary" data-dismiss="modal">关闭
                </button>
                <button id="edit_confirm" type="button" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id='deleteModal' tabindex="-1" role="dialog">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">确认删除</h4>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
                <button id="delete_confirm" type="button" class="btn btn-danger">确认</button>
            </div>
        </div>
    </div>
</div>

<link rel="stylesheet" type="text/css"
      href="/static/home/vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="/static/home/vendor/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"
        charset="UTF-8"></script>
<script type="text/javascript"
        src="/static/home/vendor/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
        charset="UTF-8"></script>
<script src="/static/home/widget/shop/indexregion/indexregion.js"></script>
<script src="/static/home/widget/shop/indexregion/deleteindexregion.js"></script>
<script src="/static/home/widget/shop/indexregion/editindexregion.js"></script>
